<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

/*Route::get('/', function () {
    return view('welcome');
});*/

Route::get('/', 'RootController@root')->name('index');
Route::get('/meeting/{id}/{response}', 'RootController@meeting')->name('meeting');

//不用
//Auth::routes();
//Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');

/*用户登陆注册相关*/
Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
Route::post('login', 'Auth\LoginController@login');
Route::post('logout', 'Auth\LoginController@logout')->name('logout');

Route::get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');
Route::post('register', 'Auth\RegisterController@register');

Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update');

Route::get('password/confirm', 'Auth\ConfirmPasswordController@showConfirmForm')->name('password.confirm');
Route::post('password/confirm', 'Auth\ConfirmPasswordController@confirm');

Route::get('email/verify', 'Auth\VerificationController@show')->name('verification.notice');
Route::get('email/verify/{id}/{hash}', 'Auth\VerificationController@verify')->name('verification.verify');
Route::post('email/resend', 'Auth\VerificationController@resend')->name('verification.resend');


/** 用户 **/
Route::resource('/users','UsersController')->only(['show','update','edit']);
/** 帖子 **/
Route::resource('/topics','TopicController')->except(['show']);
//帖子show方法重写
Route::get('/topics/{topic}/{slug?}','TopicController@show')->name('topics.show');
/** 分类 **/
Route::resource('/categories','CategoryController')->only(['show']);
/** 评论 **/
Route::resource('/replies','ReplyController')->only(['store','destroy']);
/** 消息通知 **/
Route::resource('/notifications','NotificationController')->only(['index']);

/*富文本上传文件*/
Route::post('imageUpload','TopicController@imageUpload')->name('topics.imageUpload');
